package com.nan.mybatisplus.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @Title: mybatisplus
 * @escription: this is a User Class
 * @Author: Mr.Nan
 * @Version: 1.0 2021-10-09 11:19
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    //选择自动生成主键的方法   默认雪花算法  数据库字段必须是自增的
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Integer age;
    private String email;
    //自动填充
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Version //乐观锁注解
    private Integer version;

    @TableLogic //逻辑删除
    private Integer deleted;
}
